<!DOCTYPE html>
<html lang="zh-CN">
  <head>
        <#include "/common/common_head.ftl">
        <script type="text/javascript">
        	function addForm(){
        		var title = $.trim($('#title').val());
        		var discribe = $.trim($('#discribe').val());
        		if(title == ""){
        			alert("问卷标题不能为空！");
        			return false;
        		}
        		if(discribe == ""){
					alert("规则说明不能为空！");
					return false;
        		}
        		$("#addForm").submit();
        	}
        </script>
  </head>
  <style>
  	.formbtn {
  	  text-align:center;
  	}
  </style>
  <body style="padding-top:0px">
        <!-- 主内容区域 S -->
 		<div class="" id="mainBoard">
        <#if entity??>
            <#assign operate="编辑">
        <#else>
            <#assign operate="添加">
        </#if>
		<!-- 导航路径 S -->
		<ol class="breadcrumb">
		  <li><a href="#">问卷调查管理</a></li>
		  <li class="active">${operate}信息</li>
		  <li><a href="list.do?page=${page}">返回</a></li>
		</ol>
		<!-- 导航路径 E -->

		<!-- 标题区 S -->
		<h2 class="sub-header">${operate}信息</h2>
		<!-- 标题区 E -->

		<!-- 内容区 S -->
        <#if entity??>
			<form id="addForm" action="save.do" method="post">
			    <input type="hidden" name="id" value="${entity.id?string('###')}">
		        <div class="input-group">
	                <span class="input-group-addon" id="basic-addon2">问卷标题</span>
	                <input class="form-control" id="title" placeholder="title" aria-describedby="basic-addon5" name="title" value="${entity.title?if_exists}">
	            </div>
	            <div class="input-group">
	                <span class="input-group-addon" id="basic-addon2">规则说明</span>
	                <textarea rows="8" cols="20" class="form-control" id="discribe" placeholder="discribe" aria-describedby="basic-addon5" name="discribe">${entity.discribe?if_exists}</textarea>
	            </div>
	            <div class="input-group">
	                <span class="input-group-addon" id="basic-addon2">问卷状态</span>
	                <select class="form-control" name="state" id="state">
	                    <option value="1" <#if entity.state?if_exists == 1>selected="selected"</#if>>可用</option>
	                    <option value="2" <#if entity.state?if_exists == 2>selected="selected"</#if>>停用</option>
	                </select>
	            </div>
	            <div class="input-group">
	                <span class="input-group-addon" id="basic-addon2">备注说明</span>
	                <textarea rows="3" cols="20" class="form-control" id="remark" placeholder="remark" aria-describedby="basic-addon5" name="remark">${entity.remark?if_exists}</textarea>
	            </div>
	            	<div class="formbtn"><button type="button" class="btn-primary" onclick="addForm()">提交</button></div>
			</form>
			<#else>
			<form id="addForm" action="save.do" method="post">
	            <div class="input-group">
	                <span class="input-group-addon" id="basic-addon2">问卷标题</span>
	      			<input class="form-control" id="title" placeholder="title" aria-describedby="basic-addon5" name="title">
	            </div>
	            <div class="input-group">
	                <span class="input-group-addon" id="basic-addon2">规则说明</span>
	      			<textarea rows="3" cols="20" class="form-control" id="discribe" placeholder="discribe" aria-describedby="basic-addon5" name="discribe"></textarea>
	            </div>
	            <div class="input-group">
                	<span class="input-group-addon" id="basic-addon2">问卷状态</span>
	      			<select class="form-control" name="state" id="state">
	                    <option value="1">可用</option>
	                    <option value="2">停用</option>
	                </select>
	            </div>
	            <div class="input-group">
	                <span class="input-group-addon" id="basic-addon2">备注说明</span>
	      			<textarea rows="3" cols="20" class="form-control" id="remark" placeholder="remark" aria-describedby="basic-addon5" name="remark"></textarea>
	            </div>
            	<div class="formbtn"><button type="button" class="btn-primary" onclick="addForm()">提交</button></div>
			</form>
			</#if>
		<!-- 内容区 E -->
 		<!-- 主内容区域 E -->
		
 	</div>
  </body>
</html>
